package proxy.general;

/**
 * @Author：LJ
 * @Description：代理用户类
 * @Date: 2017/11/27
 * @Modified By:
 */
public class Proxy implements Subject {
    private Subject real;

    public Proxy() {
        this.real = new RealSubject();
    }

    public Proxy(Subject subject) {
        this.real = subject;
    }

    @Override
    public void doSomething() {
        before();
        real.doSomething();
        after();
    }

    //预处理
    private void before() {

    }

    //善后处理
    private void after() {

    }
}
